﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using System.Web;
using SME.Food.Surperise.Model;

namespace SME.Food.Surperise.BLL
{
    public partial class CookieValues
    {
        public CookieValues()
		{}
       

        //public Bas_User_Model GetCookie()
        //{
        //    Bas_User_Model model = new Bas_User_Model();
        //    if (Request.Cookies["MyCook"] != null)
        //    {
        //        model.User_No = Request.Cookies["MyCook"]["User_No"];
        //        model.User_Name = Request.Cookies["MyCook"]["User_Name"];
        //        model.Mem_Power = Request.Cookies["MyCook"]["User_PassWord"];
        //        model.Mem_No = Request.Cookies["MyCook"]["Mem_No"];
        //        model.Mem_Power == Request.Cookies["MyCook"]["Mem_Power"];
        //    }   
        
        //}

        //修改Cookie  
        //protected void Button3_Click(object sender, EventArgs e)
        //{
        //    //获取客户端的Cookie对象  
        //    HttpCookie cok = Request.Cookies["MyCook"];

        //    if (cok != null)
        //    {
        //        //修改Cookie的两种方法  
        //        cok.Values["userid"] = "alter-value";
        //        cok.Values.Set("userid", "alter-value");

        //        //往Cookie里加入新的内容  
        //        cok.Values.Set("newid", "newValue");
        //        Response.AppendCookie(cok);
        //    }


        //}
        //删除Cookie  
        //protected void Button4_Click(object sender, EventArgs e)
        //{

        //    HttpCookie cok = Request.Cookies["MyCook"];
        //    if (cok != null)
        //    {
        //        if (!CheckBox1.Checked)
        //        {
        //            cok.Values.Remove("userid");//移除键值为userid的值  
        //        }
        //        else
        //        {
        //            TimeSpan ts = new TimeSpan(-1, 0, 0, 0);
        //            cok.Expires = DateTime.Now.Add(ts);//删除整个Cookie，只要把过期时间设置为现在  
        //        }
        //        Response.AppendCookie(cok);
        //    }
        //}  

    }
}
